package com.bootdo.common.utils;

import com.bootdo.fx.domain.UserInfoDO;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class LoginUtils {

    public static UserInfoDO getCurrentUser(HttpServletRequest request){
        //HttpServletRequest re = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        //UserInfoDO userInfoDO = (UserInfoDO) request.getSession().getAttribute("userInfo");
        UserInfoDO userInfoDO = new UserInfoDO();
        userInfoDO.setUserName("test");
        userInfoDO.setUserId(5L);
        userInfoDO.setUserAvatar("http://192.168.1.45:8083/static/img/home/img3.png");
        return userInfoDO;
    }

}
